// ============================== 列表请求体 ============================== //

export class ListReq {
  constructor() {
    this.obj = {
      comReq: undefined,
      comQuery: undefined,
      content: undefined,
      leftId: '',
      date: 0,
      beginDate: 0,
      endDate: 0,
      beginTime: 0,
      endTime: 0,
    }
  }

  toObject() {
    return this.obj
  }

  setComQuery(comQuery) {
    if(comQuery && comQuery.toObject) this.obj.comQuery = comQuery.toObject()
  }

  setContent(content) {
    if(content && content.toObject) this.obj.content = content.toObject()
  }

  setLeftId(leftId) {
    this.obj.leftId = leftId
  }

  setDate(date) {
    this.obj.date = date
  }

  setBeginDate(beginDate) {
    this.obj.beginDate = beginDate
  }

  setEndDate(endDate) {
    this.obj.endDate = endDate
  }

  setBeginTime(beginTime) {
    this.obj.beginTime = beginTime
  }

  setEndTime(endTime) {
    this.obj.endTime = endTime
  }
}

// ============================== 单项请求体 ============================== //

export class DetailReq {
  constructor() {
    this.obj = { id: '' }
  }

  toObject() {
    return this.obj
  }

  setId(id) {
    this.obj.id = id
  }
}

// ============================== 提交请求体 ============================== //

export class SubmitReq {
  constructor() {
    this.obj = {
      comReq: undefined,
      content: undefined,
    }
  }

  toObject() {
    return this.obj
  }

  setContent(content) {
    if(content && content.toObject) this.obj.content = content.toObject()
  }
}

// ============================== 状态请求体 ============================== //

export class StatusReq {
  constructor() {
    this.obj = { id: '', status: 0 }
  }

  toObject() {
    return this.obj
  }

  setId(id) {
    this.obj.id = id
  }

  setStatus(status) {
    this.obj.status = status
  }
}

// ============================== 登录用户请求体 ============================== //

export class TokenReq {
  constructor() {
    this.obj = {}
  }

  toObject() {
    return this.obj
  }
}
